<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><s:text name="content.list.title"/></title>
	<%@ include file="/common/meta.jsp"%>
	<%@ include file="/common/common.jsp"%>
	<link href="${ctx}/css/new_win.css" type="text/css" rel="stylesheet" />
<!--[if IE 6]>
<script type="text/javascript" src="js/DD_belatedPNG.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('.leftmenu dd.current,.leftmenu dd a,.leftmenu dt span,.menushow dt');
</script>
<![endif]-->
</head>
<body>
<div class="popwrapper">
<div class="lighttit"><span class="fl">所属专题：<s:text name=""/><s:property value="topic.topicName"/></span>
			<div class="hd_01">  
			<ul>
			<li class="cssa color_888">欢迎你, <tt> <s:property value="#session.currentAdmin.loginName" />(<s:property value="#session.currentAdmin.realName" />)</tt></li>
			<s:if test="#session['CURRENT_SITE']==null">
			<li class="cssa color_9cf"><a onclick="showSelSite();">请选择站点</a></li>
			</s:if>
			<s:else>
				<li class="cssa  color_888">当前站点：<tt><s:property  value="#session['CURRENT_SITE'].siteName"/> </tt></li>
			</s:else>
			</ul>
			</div>


</div>
<div class="lightmain">
	<table width=100%>
		<tr>
			<td id="menu" valign="top"  width="159">
				<div class="popmenu fl">
		<div class="leftmenu fl">
			<dl>
				<dt>专题内容管理</dt>
				<!-- <dd class="current"><a href="#" onclick="addContent()" target="popframe">新增文章</a></dd> -->
				<%-- <dd><a href="${ctx}/content/content-list.action?tflag=1&content.topic.topicId=4028839d303136090130313a2e050001&content.topic.keywords=gg" >文章列表</a></dd> --%>
				<dd id="contList"><a href="#" onclick="contenList()">文章列表</a></dd>
				<s:if test="content.topic.isAudit==true">
					<dd id="auditList"><a href="#" onclick="checkContent()">审核文章</a></dd>
				</s:if>
				<dd id="topicList"><a href="#" onclick="tplSelect()">专题模板</a></dd>
				<dd id="keyList"><a href="#" onclick="keyWords()">关键字</a></dd>
				<dd id="contList"><a href="#">预览</a></dd>
			</dl>
		</div>
	</div>
</td>
<td valign="top"  width="100%">
<div class="popmain fr">
<frame src="" name="popframe" scrolling="auto" noresize>
 <div class="wrapper"  id="main" >
	<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/main.action"><s:text name="homepage"/></a><span>></span><s:text name="专题内容管理"/></div>
	<div class="listtit" id="listtit"><p><span><strong><s:text name="content.list.title"/>><s:property value="topic.topicName"/></strong></span></p></div>
	<s:hidden name="topic.keywords" id="keyword"/>
	<s:hidden name="topic.topicName" id="topicName"/>
	<s:form action="content-listnotin" method="get" id="action_form">
	<s:hidden name="topic.topicId" id="tId"/>
	<s:hidden name="tflag" id="tflag"/>	
	<div class="searchbox">
		<table class="searchTable">
			<tbody id="searchTable">
				<tr>
					<s:if test="tflag==3">
						<td class="text"><label for="search" class="labelKeywords"><s:text name="key.words"/>:</label></td>
						<td><s:textfield name="content.keywords"  required="true" requiredposition="right" cssClass="txtin" id="keywd"/></td>
						<td>
						<s:if test="%{authLicence('4_4_3',topic.topicId)}">
							 <input type="button" value="<s:text name="query"/>" class="btnsearch" id="search_btn"/>
							 <input type="button"  value="<s:text name="save"/>" class="btnsearch" id="save_btn"/>
						</s:if>
						<s:else>
							 <input type="button" value="<s:text name="query"/>" class="btnsearch"/>
							 <input type="button"  value="<s:text name="save"/>" class="btnsearch"/>
						</s:else>
						 <span style="color: #457d07">(保存多个关键字或搜索时请用"逗号"或"空格"隔开)</span>
						</td>
					</s:if>
					<s:if test="tflag==1">
						<td class="text"><label for="search" class="labelKeywords"><s:text name="key.words"/>:</label></td>
						<td><s:textfield name="" required="true" requiredposition="right" cssClass="txtin" id="contkeywd"/></td>
						
						<td class="text"><label for="qry_contentStatus"><s:text name="文章类型"/>: </label></td>
						<td class="input"><s:select id="cType" list="dicContentTp"  cssClass="selectClass" listKey="dictionaryKey" listValue="dictionaryValue" headerKey=" " headerValue="---请选择---"/></td>
						
						<td class="text"><label for="qry_contentStatus"><s:text name="content.contentStatus"/>: </label></td>
						<td class="input"><s:select id="contType" list="dicContentType" value="content.contentStatus" name="content.contentStatus" cssClass="selectClass" listKey="dictionaryKey" listValue="dictionaryValue" headerKey=" " headerValue="---请选择---"/></td>
						<td>
							<input type="button" value="<s:text name="query"/>" class="btnsearch" id="searchCont_btn"/>
						</td>
					</s:if>
					
				</tr>
			</tbody>
		</table>
		<div class="searchboxrt">
			
	    </div>
		<div class="clear"></div>
	</div>
	<div class="listoperate">
			<s:if test="showfla!=null&&showfla.equals(\"1\")">
				<s:if test="%{authLicence('4_4_3',topic.topicId)}">
					<%-- <input id="top_new_btn" type="button" value="<s:text name="new"/>" class="btnadd"/> --%>
					<span class="cssa"  id="top_new_btn_f" ><input id="top_new_btn" type="button" value="<s:text name="new"/>" class="btnadd"/> 
					<div class="listydzlayer" id="addType">
						<a href="#" id="normal_content">普通文章</a>
						<a href="#" id="software_content">软件文章</a>
						<a href="#" id="picture_content">图片文章</a>
						<a href="#" id="video_content">视频文章</a>
						<a href="#" id="flash_content">动画文章</a>
						<a href="#" id="link_content">链接文章</a>
					</div> 
					
					</span>
				</s:if>
			</s:if>
		<span>
		<s:if test="showfla!=null&&showfla.equals(\"1\")">
			<input type="button" value="<s:text name="anti-selection"/>" class="btnlist2" id="top_anti_btn"/>
			<input type="button" value="展示状态修改"  class="btnlist4" id="top_showType_t"/>
			<input type="button" value="评论控制"  class="btnlist4" id="top_isComment_t"/>
		</s:if>
		<s:if test="keycont!=null&&keycont.equals(\"1\")">
			<input type="button" value="<s:text name="content.ignore"/>"  class="btnlist2" id="top_ignore_btn"/>
			<input type="button" value="<s:text name="content.noIgnore"/>"  class="btnlist4" id="top_noIgnore_btn"/>
		</s:if>
		</span>
	</div>

	
	<div class="listbox" id="listbox">
		<table class="listgrid" id="listbox">
			<tbody>
				<tr>
					<th><input type="checkbox" name="all" id="all_check"/></th>					
					<th><s:text name="content.contextType"/></th>
					<th><s:text name="content.contentTitle"/></th>	
					<th><s:text name="关键字"/></th>			
					<th><s:text name="updater"/></th>
					<th><s:text name="publisher"/></th>
					<th><s:text name="content.contentStatus"/></th>
					<th><s:text name="content.contentHits"/></th>				
					<s:if test="showfla!=null&&showfla.equals(\"1\")">
					<th><s:text name="operate"/></th>
					</s:if>
				</tr>
				<s:iterator value="page.result">
					<tr>
					<td <s:if test="contentStatus.equals(\"4\")">title="文章已锁定"</s:if> ><input type="checkbox"  value="<s:property value="contentId"/>" id="<s:property value="contentTitle"/>" alt="<s:property value="contentStatus"/>" <s:if test="contentStatus.equals(\"4\")">disabled="disabled"</s:if><s:else>  name="key"</s:else> /></td>
					<td><s:text name="content.contextType.%{contextType}"/></td>
					<td class="talign_l max_width300" name="contentTitle"><s:property value="contentTitle"/>&nbsp;</td>			
					<td><s:property value="keywords"/>&nbsp;</td>		
					<td><s:property value="updateRealName"/>&nbsp;</td>
					<td><s:property value="publishRealName"/>&nbsp;</td>
					<td><s:property value="%{getName(contentStatus,'CONTENT_STATUS')}"/>&nbsp;</td>
					<td><s:property value="contentHits"/>&nbsp;</td>
					<s:if test="showfla!=null&&showfla.equals(\"1\")">
						<td>
							<s:if test="contentStatus.equals(\"4\")">
								<s:if test="adminLoginName.equals(updateLoginName)">
									<a href="#this" onclick="unlock('<s:property value="contentId"/>')">解锁</a>
								</s:if>
								<s:elseif test="%{authLicence('4_4_6',topic.topicId)}">
									<a href="#this" onclick="unlock('<s:property value="contentId"/>')">解锁</a>
								</s:elseif>
								<s:else>文章已被锁定</s:else>
							</s:if>
							<s:else>
							<s:if test="tflag==2">
								<s:if test="%{authLicence('4_4_4',topic.topicId)}">	
									<a href="#this" onclick="goAudit('<s:property value="contentId"/>','1','<s:property value="contextType"/>')">审核</a><tt>|</tt>
								</s:if>
								<s:else><span class="disable">审核</span><tt>|</tt></s:else>
							</s:if>
								<s:if test="content.topic.isAudit==false">
									<s:if test="tflag==1">
										<s:if test="%{authLicence('4_4_2',topic.topicId)}">	
											<a href="#this" onclick="goPublish('<s:property value="contentId"/>','3')">发布</a><tt>|</tt>
										</s:if>
										<s:else><span class="disable">发布</span><tt>|</tt></s:else>
									</s:if>
								</s:if>
								<s:else>
									<s:if test="tflag==1">
										<s:if test="contentStatus.equals(\"1\")">
											<s:if test="%{authLicence('4_4_2',topic.topicId)}">	
												<a href="#this" onclick="goPublish('<s:property value="contentId"/>','3')">发布</a><tt>|</tt>
											</s:if>
											<s:else><span class="disable">发布</span><tt>|</tt></s:else>
										</s:if>
									</s:if>
								</s:else>
								<s:if test="%{authLicence('4_4_3',topic.topicId)}">	
									<s:if test="tflag==1">
										<s:if test="contextType.equals(\"Content\")"><a href="#this" onclick="goContentEdit('content.contentId','<s:property value="contentId"/>')"><s:text name="edit"/></a></s:if>
										<s:if test="contextType.equals(\"VideoContent\")"><a href="#this" onclick="goVideoEdit('videoContent.contentId','<s:property value="contentId"/>')"><s:text name="edit"/></a></s:if>
										<s:if test="contextType.equals(\"FlashContent\")"><a href="#this" onclick="goFlashEdit('flashContent.contentId','<s:property value="contentId"/>')"><s:text name="edit"/></a></s:if>
										<s:if test="contextType.equals(\"LinkContent\")"><a href="#this" onclick="goLinkEdit('linkContent.contentId','<s:property value="contentId"/>')"><s:text name="edit"/></a></s:if>
										<s:if test="contextType.equals(\"PictureContent\")"><a href="#this" onclick="goPicEdit('pictureContent.contentId','<s:property value="contentId"/>')"><s:text name="edit"/></a></s:if>
										<s:if test="contextType.equals(\"SoftwareContent\")"><a href="#this" onclick="goSoftEdit('softwareContent.contentId','<s:property value="contentId"/>')"><s:text name="edit"/></a></s:if>
									</s:if>
									<tt>|</tt>
								    <a href="#this" onclick="goContentDel('<s:property value="contentId"/>')"><s:text name="delete"/></a>
								</s:if>
								<s:else>
									<s:if test="tflag==1">
										<s:if test="contextType.equals(\"Content\")"><span class="disable"><s:text name="edit"/></span></s:if>
										<s:if test="contextType.equals(\"VideoContent\")"><span class="disable"><s:text name="edit"/></span></s:if>
										<s:if test="contextType.equals(\"FlashContent\")"><span class="disable"><s:text name="edit"/></span></s:if>
										<s:if test="contextType.equals(\"LinkContent\")"><span class="disable"><s:text name="edit"/></span></s:if>
										<s:if test="contextType.equals(\"PictureContent\")"><span class="disable"><s:text name="edit"/></span></s:if>
										<s:if test="contextType.equals(\"SoftwareContent\")"><span class="disable"><s:text name="edit"/></span></s:if>
									</s:if>	
									<tt>|</tt>
								    <span class="disable"><s:text name="delete"/></span>
						    	</s:else>
						    </s:else>
						</td>
					</s:if>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		
	</div>
	<div class="listoperateb h60">
		
		<span class="fl">
		<s:if test="showfla!=null&&showfla.equals(\"1\")">
			<input type="button" value="<s:text name="anti-selection"/>" class="btnlist2" id="bottom_anti_btn"/>
			<input type="button" value="展示状态修改"  class="btnlist4" id="bottom_showType_t"/>
			<input type="button" value="评论控制"  class="btnlist4" id="bottom_isComment_t"/>
		</s:if>
		<s:if test="keycont!=null&&keycont.equals(\"1\")">
			<s:if test="%{authLicence('4_4_3',topic.topicId)}">
	 		   <input type="button" value="<s:text name="content.ignore"/>"  class="btnlist2" id="bottom_ignore_btn"/>
			</s:if>
			<s:else>
				<input type="button" disabled="disabled" value="<s:text name="content.ignore"/>"  class="btnlist2" id="bottom_ignore_btn"/>
			</s:else>
			<s:if test="%{authLicence('4_4_3',topic.topicId)}">
	 		  <input type="button" value="<s:text name="content.noIgnore"/>"  class="btnlist4" id="bottom_noIgnore_btn"/>
			</s:if>
			<s:else>
				<input type="button" disabled="disabled" value="<s:text name="content.noIgnore"/>"  class="btnlist4" id="bottom_noIgnore_btn"/>
			</s:else>
		</s:if>
		</span>
		<div class="pager fr w550"><z:page numberNav="true" selectPageSize="true" input="true" id="ctrl"/></div>
	</div>
</div>
<div id="lightbox_s" class="lightbox" >
	<div class="lighttit"><p><span><input type="button" value="&nbsp;" id="lightclose_s" class="lightclose" /><strong>展示状态修改</strong></span></p></div>
	<div class="lightmain">
		<div class="lightmaintit">展示状态修改
			<input type="checkbox" name="isTop_f" id="isTop_f"/><label for="isTop_f">置顶</label>
			<input type="checkbox" name="showType_o" id="showType_o_1"/><label for="showType_o_1">原创</label>
			<input type="checkbox" name="showType_o" id="showType_o_2"/><label for="showType_o_2">转载</label>
			<input type="checkbox" name="showType_o" id="showType_o_3"/><label for="showType_o_3">最新</label>
			<input type="checkbox" name="showType_o" id="showType_o_4"/><label for="showType_o_4">推荐</label>
			<input type="checkbox" name="showType_o" id="showType_o_5"/><label for="showType_o_5">精选</label>
			<input type="checkbox" name="showType_o" id="showType_o_6"/><label for="showType_o_6">热点</label>
		</div>
		<div class="ilghtmainbox" >
			<div id="authorSetDiv" >
				<table class="listgridb" cellspacing="1" id="listbox">
					<tbody>
						<tr>
							<td><select multiple="multiple" id="old_s" style="height: 300px;width: 200px"></select></td>
							<td>
								<input type="button" class="btnlist4" id="addall_s" value="===>"/><br/><br/>
								<input type="button" class="btnlist4" id="add_s" value="--->"/><br/><br/>
								<input type="button" class="btnlist4" id="del_s" value="<---"/><br/><br/>
								<input type="button" class="btnlist4" id="delall_s" value="<==="/>
							</td>
							<td><select multiple="multiple" id="new_s"  style="height: 300px;width: 200px"></td>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="lightbtnbox"><input type="button" value="确认" id="lightsubmit_s" class="btnlist2"/></div>
	</div>
</div>
<div id="lightbox_t" class="lightbox" >
	<div class="lighttit"><p><span><input type="button" value="&nbsp;" id="lightclose_t" class="lightclose" /><strong>模板更换</strong></span></p></div>
	<div class="lightmain">
		<div class="lightmaintit">模板更换
			<s:select name="content.contentTpl" list="toptpllist" /></select>
		</div>
		<div class="ilghtmainbox" >
			<div id="authorSetDiv" >
				<table  class="listgridb" cellspacing="1" id="listbox">
					<tbody>
						<tr>
							<td><select multiple="multiple" id="old_t" style="height: 300px;width: 200px"></select></td>
							<td>
								<input type="button" class="btnlist4" id="addall_t" value="===>"/><br/><br/>
								<input type="button" class="btnlist4" id="add_t" value="--->"/><br/><br/>
								<input type="button" class="btnlist4" id="del_t" value="<---"/><br/><br/>
								<input type="button" class="btnlist4" id="delall_t" value="<==="/>
							</td>
							<td><select multiple="multiple" id="new_t"  style="height: 300px;width: 200px"></td>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="lightbtnbox"><input type="button" value="确认" id="lightsubmit_t" class="btnlist2"/></div>
	</div>
</div>
<div id="lightbox_c" class="lightbox" >
	<div class="lighttit"><p><span><input type="button" value="&nbsp;" id="lightclose_c" class="lightclose" /><strong>评论控制</strong></span></p></div>
	<div class="lightmain">
		<div class="lightmaintit">评论控制
			<s:if test="content.category.isComment">
			<input type="radio" name="isComment" value="true" id="yes" checked="checked"/><label for="yes">允许评论</label> 
			<input type="radio" name="isComment" value="false" id="no"/><label for="no">不允许评论</label> 
			</s:if>
			<s:else>
			<input type="radio" name="isComment" value="1" id="yes" disabled="disabled"/><label for="yes">允许评论</label> 
			<input type="radio" name="isComment" value="0" id="no" checked="checked" disabled="disabled"/><label for="no">不允许评论</label> 
			</s:else>
		</div>
		<div class="ilghtmainbox" >
			<div id="authorSetDiv" >
				<table  class="listgridb" cellspacing="1" id="listbox">
					<tbody>
						<tr>
							<td><select multiple="multiple" id="old_c" style="height: 300px;width: 200px"></select></td>
							<td>
								<input type="button" class="btnlist4" id="addall_c" value="===>"/><br/><br/>
								<input type="button" class="btnlist4" id="add_c" value="--->"/><br/><br/>
								<input type="button" class="btnlist4" id="del_c" value="<---"/><br/><br/>
								<input type="button" class="btnlist4" id="delall_c" value="<==="/>
							</td>
							<td><select multiple="multiple" id="new_c"  style="height: 300px;width: 200px"></td>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="lightbtnbox"><input type="button" value="确认" id="lightsubmit_c" class="btnlist2"/></div>
	</div>
</div>
<div id="lightbox_b" class="lightbox" >
	<div class="lighttit"><p><span><input type="button" value="&nbsp;" id="lightclose_b" class="lightclose" /><strong>内容移动</strong></span></p></div>
	<div class="lightmain">
		<div class="lightmaintit">
			移动至：<select><option>123</option></select>
		</div>
		<div class="ilghtmainbox" >
			<div id="authorSetDiv" >
				<table  class="listgridb" cellspacing="1" id="listbox">
					<tbody>
						<tr>
							<td><select multiple="multiple" id="old_b" style="height: 300px;width: 200px"></select></td>
							<td>
								<input type="button" class="btnlist4" id="addall_b" value="===>"/><br/><br/>
								<input type="button" class="btnlist4" id="add_b" value="--->"/><br/><br/>
								<input type="button" class="btnlist4" id="del_b" value="<---"/><br/><br/>
								<input type="button" class="btnlist4" id="delall_b" value="<==="/>
							</td>
							<td><select multiple="multiple" id="new_b"  style="height: 300px;width: 200px"></td>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="lightbtnbox"><input type="button" value="确认" id="lightsubmit_b" class="btnlist2"/></div>
	</div>
</div>
</s:form>
				<div id="tpl" class="wrapper" style="display: none">
					<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/welcome.action"><s:text name="homepage"/></a><span>></span><s:text name="content.title"/></div>
	<div class="listtit" id="listtit"><p><span><strong><s:text name="content.list.title"/>><s:property value="content.category.catName"/></strong></span></p></div>
			<table class="addgrid">
				<tr>
					<th><s:text name="首页模板"/>:</th>
					<td>
						<s:textfield name="topic.topicIndexTpl" id="topicselectIndex"  required="true" onclick="selectIndex()" requiredposition="right" cssClass="txtin w400" readonly="true"/>
						<a href="#"  onclick="selectIndex()"><s:text name="choice"/></a>
						<input type="button" value="<s:text name="reset"/>" class="btnlist2" id="bottom_indexreset_btn"/>
					</td>
				</tr>
				<tr>
					<th><s:text name="列表模板"/>:</th>
					<td>
						<s:textfield name="topic.topicContextListTpl" id="topicContentListTpl" onclick="contentListTpl()" required="true" requiredposition="right" cssClass="txtin w400" readonly="true"/>
						<a href="#"  onclick="contentListTpl()"><s:text name="choice"/></a>
						<input type="button" value="<s:text name="reset"/>" class="btnlist2" id="bottom_listReset_btn"/>
					</td>
				</tr>
			 <tr>
				<th><s:text name="默认模板"/>:</th>
				<td>
					<s:textfield name="topic.topicDefaultContentTpl" id="topicDefaultContentTpl" onclick="defaultContentTpl()" required="true" requiredposition="right" cssClass="txtin w400" readonly="true"/>
					<a href="#"  onclick="defaultContentTpl()"><s:text name="choice"/></a>
					<input type="button" value="<s:text name="reset"/>" class="btnlist2" id="bottom_defaultReset_btn"/>
				</td>
			</tr>
				<tr>
				<th><s:text name="可选模版"/>:</th>
				<td>
					<s:textfield name="topic.topicContentTplSet" id="topicContentTplSet" required="true" onclick="contentTplSet()" requiredposition="right" cssClass="txtin w400" readonly="true"/>
					<a href="#"  onclick="contentTplSet()"><s:text name="choice"/></a>
					<input type="button" value="<s:text name="reset"/>" class="btnlist2" id="bottom_con_btn"/>
				</td>
			</tr>
			<tr>
				<td colspan='2'>
					<s:if test="%{authLicence('4_4_3',topic.topicId)}">
						<input type="button"  value="<s:text name="save"/>" class="btnlist2 ml300" id="bot_save_btn"/>
					</s:if>
					<s:else>
					    <input type="button" disabled="disabled" value="<s:text name="save"/>" class="btnlist2 ml300" id="bot_save_btn"/>
					</s:else>
					
				</td>
			</tr>
			</table>
				</div>
			</frame>
	</div>
			</td>
		</tr>
	</table>
</div>
</div>
</body>
</html>
<script type="text/javascript">
$$.layer("#top_new_btn_f","#addType","91");
</script>
<script type="text/javascript" defer="defer">

//内容移动
$("#listydzB").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#listydzB","#lightclose_b,#lightsubmit_b","#lightbox_b","600");
	var str="";
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_b").append(str);
});
$("#lightclose_b").click(function(){
	$("#old_b option").remove();
	$("#new_b option").remove();
});
$("#addall_b").click(function(){
	$("#new_b").append($("#old_b").html());
	$("#old_b option").remove();
});
$("#delall_b").click(function(){
	$("#old_b").append($("#new_b").html());
	$("#new_b option").remove();
});
$("#add_b").click(function(){
	$("#new_b").append($("#old_b option:checked"));
	$("#old_b option:checked").remove();
});
$("#del_b").click(function(){
	$("#old_b").append($("#new_b option:checked"));
	$("#new_b option:checked").remove();
});
$("#lightsubmit_b").click(function(){
	alert("success");
});
//修改展示状态
$("#self").click(function(){
	if($(this).attr("checked")==""){
		$("#from").attr("checked","checked");
	}else{
		$("#from").attr("checked","");
	}
});
$("#from").click(function(){
	if($(this).attr("checked")==""){
		$("#self").attr("checked","checked");
	}else{
		$("#self").attr("checked","");
	}
});
$("#top_showType_t").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#top_showType_t","#lightclose_s,#lightsubmit_s","#lightbox_s","600");
	var str="";
	$("#self").attr("checked","checked");
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_s").append(str);
});
$("#bottom_showType_t").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#bottom_showType_t","#lightclose_s,#lightsubmit_s","#lightbox_s","600");
	var str="";
	$("#self").attr("checked","checked");
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_s").append(str);
});
$("#lightclose_s").click(function(){
	$("#old_s option").remove();
	$("#new_s option").remove();
	$("input[name=isTop_f]").attr("checked","");
	$("input[name=showType_o]").each(function(){
		$(this).attr("checked","");
	});
});
$("#addall_s").click(function(){
	$("#new_s").append($("#old_s").html());
	$("#old_s option").remove();
});
$("#delall_s").click(function(){
	$("#old_s").append($("#new_s").html());
	$("#new_s option").remove();
});
$("#add_s").click(function(){
	$("#new_s").append($("#old_s option:checked"));
	$("#old_s option:checked").remove();
});
$("#del_s").click(function(){
	$("#old_s").append($("#new_s option:checked"));
	$("#new_s option:checked").remove();
});
$("#lightsubmit_s").click(function(){
	var contentId = "";
	var isTop;
	var showType = "";
	if($("input[name=isTop_f]").attr("checked")==""){
		isTop = false;
	}else{
		isTop = true;
	}
	$("input[name=showType_o]").each(function(){
		if($(this).attr("checked")==""){
			showType+="0";
		}else{
			showType+="1";
		}
	});
	showType+="0";
	var obj="";
	obj+=showType.substring(0, 1);
	obj+=showType.substring(2, showType.length);
	showType = obj;
	$("#new_s option").each(function(){
		contentId += $(this).val()+",";
	});
	if(contentId!=""){
		$.ajax({	
			url:"${ctx}/content/content-batch.action?time="+new Date().getTime(),
			data:{"content.contentId":contentId,
				  "content.isTop":isTop,
				  "content.showType":showType},
			dataType:"text",
			type:"post",
			success:function(data){
				if(data=="sure"){
					alert("更改成功！");
					location.reload();
				}else{
					alert("更改失败！"); 
				}
			}
		});
	} 
	$("#old_s option").remove();
	$("#new_s option").remove();
	$("input[name=isTop_f]").attr("checked","");
	$("input[name=showType_o]").each(function(){
		$(this).attr("checked","");
	});
});
//模板更换
$("#top_contentTpl_t").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#top_contentTpl_t","#lightclose_t,#lightsubmit_t","#lightbox_t","600");
	var str="";
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_t").append(str);
});
$("#bottom_contentTpl_t").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#bottom_contentTpl_t","#lightclose_t,#lightsubmit_t","#lightbox_t","600");
	var str="";
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_t").append(str);
});
$("#lightclose_t").click(function(){
	$("#old_t option").remove();
	$("#new_t option").remove();
});
$("#addall_t").click(function(){
	$("#new_t").append($("#old_t").html());
	$("#old_t option").remove();
});
$("#delall_t").click(function(){
	$("#old_t").append($("#new_t").html());
	$("#new_t option").remove();
});
$("#add_t").click(function(){
	$("#new_t").append($("#old_t option:checked"));
	$("#old_t option:checked").remove();
});
$("#del_t").click(function(){
	$("#old_t").append($("#new_t option:checked"));
	$("#new_t option:checked").remove();
});
$("#lightsubmit_t").click(function(){
	var contentId = "";
	var tplId = $("select[name=contentTpl] option:selected").val();
	$("#new_t option").each(function(){
		contentId += $(this).val()+",";
	});
	if(contentId!=""){
		$.ajax({	
			url:"${ctx}/content/content-batch.action?time="+new Date().getTime(),
			data:{"content.contentId":contentId,
				  "content.contentTpl":tplId},
			dataType:"text",
			type:"post",
			success:function(data){
				if(data=="sure"){
					alert("更改成功！"); 
					location.reload();
				}else{
					alert("更改失败！"); 
				}
			}
		});
	}
	$("#old_t option").remove();
	$("#new_t option").remove();
});
//评论控制
$("#top_isComment_t").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#top_isComment_t","#lightclose_c,#lightsubmit_c","#lightbox_c","600");
	var str="";
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_c").append(str);
});
$("#bottom_isComment_t").click(function(){
	var ids = inputvalue();
	if(ids=="on"){
		alert("您未选择任何一个");
		return; 
	}
	$$.shade("#bottom_isComment_t","#lightclose_c,#lightsubmit_c","#lightbox_c","600");
	var str="";
	$("input[name=key]:checked").each(function(){
		str+="<option value="+$(this).attr("value")+">"+$(this).attr("id")+"</option>";
	});
	$("#old_c").append(str);
});
$("#lightclose_c").click(function(){
	$("#old_c option").remove();
	$("#new_c option").remove();
});
$("#addall_c").click(function(){
	$("#new_c").append($("#old_c").html());
	$("#old_c option").remove();
});
$("#delall_c").click(function(){
	$("#old_c").append($("#new_c").html());
	$("#new_c option").remove();
});
$("#add_c").click(function(){
	$("#new_c").append($("#old_c option:checked"));
	$("#old_c option:checked").remove();
});
$("#del_c").click(function(){
	$("#old_c").append($("#new_c option:checked"));
	$("#new_c option:checked").remove();
});
$("#lightsubmit_c").click(function(){
	var contentId = "";
	var isComment = $("input[name=isComment]:checked").val();
	$("#new_c option").each(function(){
		contentId += $(this).val()+",";
	});
	if(contentId!=""){
		$.ajax({	
			url:"${ctx}/content/content-batch.action?time="+new Date().getTime(),
			data:{"content.contentId":contentId,
				  "content.isComment":isComment},
			dataType:"text",
			type:"post",
			success:function(data){
				if(data=="sure"){
					alert("更改成功！"); 
					location.reload();
				}else{
					alert("更改失败！"); 
				}
			}
		});
	}
	$("#old_c option").remove();
	$("#new_c option").remove();
});

	var topicId = $("#tId").val();
	//移动至下拉菜单显示/隐藏
	$(function(){
		$("#listydz").hover(function(){
			$("#listydzlayer").show();
		},function(){
			$("#listydzlayer").hide();
		});
		$("#listydzlayer").hover(function(){
			$("#listydzlayer").show();
		},function(){
			$("#listydzlayer").hide();
		});
	});
	//移动至下拉菜单显示/隐藏
	$(function(){
		$("#listydz2").hover(function(){
			$("#listydzlayer2").show();
		},function(){
			$("#listydzlayer2").hide();
		});
		$("#listydzlayer2").hover(function(){
			$("#listydzlayer2").show();
		},function(){
			$("#listydzlayer2").hide();
		});
	});
	//移动至下拉菜单显示/隐藏
	$(function(){
		$("#top_new_btn").hover(function(){
			$("#addType").show();
		},function(){
			$("#addType").hide();
		});
		$("#addType").hover(function(){
			$("#addType").show();
		},function(){
			$("#addType").hide();
		});
	});
	
	actionName = "content";	
	confirmStr = "<s:text name="delete.confirm"/>";
	chiocenothing = "<s:text name="chiocenothing"/>";
	$(function(){
		$("#top_new_btn").click(goNormalContentNew);
 		$("#normal_content").click(goNormalContentNew);
 		$("#picture_content").click(goPictureContentNew);
 		$("#video_content").click(goVideoContentNew);
 		$("#flash_content").click(goFlashContentNew);
 		$("#link_content").click(goLinkContentNew);
 		$("#software_content").click(goSoftwareContentNew);
 		$("#top_anti_btn").click(antiSelect);
 		$("#top_del_btn").click(goBatchDel);
 		$("#bottom_del_btn").click(goBatchDel);
 		$("#bottom_anti_btn").click(antiSelect);
		$("#search_btn").click(searchByKeywords);
		$("#searchCont_btn").click(searchByStatus);
		
		$("#all_check").click(selAll);
		$("#extend").click(extend);
		$("#save_btn").click(saveKeywords);
		$("#bottom_ignore_btn").click(elide);
		$("#bottom_noIgnore_btn").click(unelide);
		$("#top_ignore_btn").click(elide);
		$("#top_noIgnore_btn").click(unelide);
		
		$("#bottom_indexreset_btn").click(indexReset);
		$("#bottom_listReset_btn").click(listReset);
		$("#bottom_defaultReset_btn").click(defaultReset);
		$("#bottom_con_btn").click(conReset);
		$("#bot_save_btn").click(saveTpl);
		/* $("#top_publish").click(publish);
		$("#bottom_publish").click(publish); */
		
		
	});
/* 	
	function publish(){
		if($("input[name='key']:checked").size()==0){
			alert(chiocenothing);
			return;
		}
		var id ='';
		$("input[name='key']:checked").each(function(){
			if($(this).attr("alt")!=1&&$(this).attr("alt")!=3){
				alert("文章无法发布！请选择可发布的文章");
				return false;
			}
			id+=$(this).val()+",";
		});
		document.location.href = "${ctx}/generate/publish-content.action?tflag=1&orig=input&contextType=0&topic.topicId="+topicId"/>&targets="+id+"&cflag=3&type=content";
	} */
	
	//重置
	function indexReset(){
		$("#topicselectIndex").val("default1.tpl");
	}
	function listReset(){
		$("#topicContentListTpl").val("default2.tpl");
	}
	function defaultReset(){
		$("#topicDefaultContentTpl").val("default3.tpl");
	}
	function conReset(){
		$("#topicContentTplSet").val("default4.tpl");
	}
	
	//保存模板
	function saveTpl(){
		var topicselectIndex = $("#topicselectIndex").val();
		var topicContentListTpl = $("#topicContentListTpl").val();
		var topicDefaultContentTpl = $("#topicDefaultContentTpl").val();
		var topicContentTplSet = $("#topicContentTplSet").val();
		
		var obj = {"topic.topicId":topicId,"topic.topicIndexTpl":topicselectIndex,"topic.topicContextListTpl":topicContentListTpl,"topic.topicDefaultContentTpl":topicDefaultContentTpl,"topic.topicContentTplSet":topicContentTplSet};
		
		$.get("${ctx}/topic/topic-savetpl.action",obj,function(data){
			if(data == "ok"){
				alert("模板保存成功");
			}else{
				alert("模板保存失败");
			}
		});
		
	}
	var g = function(D) {
		if ( D.indexOf(" ") == -1){
			return ( D.substring(0,1) === "#") ? document.getElementById(D.substring(1,D.length)) : document.getElementsByTagName(D);
		}
		else {
			var ary = D.split(" ");
			return g(ary[0]).getElementsByTagName(ary[1]);
		}
	};
	function inputvalue(){
		var d = g("#listbox input"), i = 0, j = d.length, str = "";
	    for ( ; i < j ; i ++ ) {
				str += (d[i].type == "checkbox" && d[i].id != "totalCheck" && d[i].checked == true ) ? d[i].value + "@" : "";
		};	
		return (str.slice(0,-1));
	};
	
	function addContent(){
		goNormalContentNew();
	}
	
	//样式改变
	var tflag = $("#tflag").val();
	if(tflag == 1){
		$("#contList").removeClass("").addClass("current");
	}
	if(tflag == 2){
		$("#auditList").removeClass("").addClass("current");
	}
	if(tflag == 3){
		$("#keyList").removeClass("").addClass("current");
	}
	
	//保存关键字
	function saveKeywords(){
		var keywd = $("#keywd").val();
		var obj = {"topic.topicId":topicId,"topic.keywords":keywd};
		if(keywd != null && keywd != ""){
			$.post("${ctx}/topic/topic-savekeywords.action",obj,function(data){
				if(data == "yes"){
					alert("关键字保存成功");
				}
			});
		}else{
			alert("关键字不能为空");
		}
	}
	//根据关键字查询
	function searchByKeywords(){
		$("#ctrl_page_input").val(1);
		var keywd = $("#keywd").val();
		document.location.href="content-listnotin.action?tflag=3&topic.topicId="+topicId+"&content.keywords="+keywd+"&content.contentStatus=3";
	}
	//根据文章状态查询
	function searchByStatus(){
		$("#ctrl_page_input").val(1);
		var contType = $("#contType").val();
		var cType = $("#cType").val();
		var contkeywd = $("#contkeywd").val();
		document.location.href="content-list.action?tflag=1&topic.topicId="+topicId+"&content.contentStatus="+contType+"&content.keywords="+contkeywd+"&conType="+cType;
	}
	//忽略文章
	function elide(){
		var myDate=new Date();
		var ids = inputvalue();
		if(ids=="on"){
			alert("请选择要忽略的文章");
			return; 
		}
		if(!ids){
			alert("请选择要忽略的文章");
			return;		
		}
		$.get("${ctx}/topic/topiccontent-save.action?topicContent.topic.topicId="+topicId+"&ids="+ids+"&myTime="+myDate,function(data){
			if(data == "yes"){
				alert("忽略成功");
			}else{
				alert("您选择了已经忽略的文章");
			}
		});
	}
	//取消忽略
	function unelide(){
		var myDate=new Date();
		var ids = inputvalue();
		if(ids=="on"){
			alert("请选择要取消忽略的文章");
			return; 
		}
		if(!ids){
			alert("请选择要取消忽略的文章");
			return;		
		}
		$.get("${ctx}/topic/topiccontent-delete.action?topicContent.topic.topicId="+topicId+"&ids="+ids+"&myTime="+myDate,function(data){
			if(data == "yes"){
				alert("取消忽略成功");
			}else{
				alert("该文章已经取消忽略");
			}
		});
	}
	//选择专题模板
	function tplSelect(){
		$("#tpl").css("display","");
		$("#main").css("display","none");
		$("#topicList").removeClass("").addClass("current");
	    $("#contList").removeClass("current");
		$("#auditList").removeClass("current");
		$("#keyList").removeClass("current");
		$("#contList").removeClass("current");
	}
	//文章列表
	function contenList(){
		$("#hulue_bottom").css("display","none");
		$("#hulue_top").css("display","none");
		$("#tpl").css("display","none");
		$("#main").css("display","");
		document.location.href="content-list.action?tflag=1&topic.topicId="+topicId;
	}
	//审核文章列表
	function checkContent(){
		$("#hulue_bottom").css("display","none");
		$("#hulue_top").css("display","none");
		$("#tpl").css("display","none");
		$("#main").css("display","");
		document.location.href="content-list.action?tflag=2&topic.topicId="+topicId;
	}
	//关键字文章列表
	function keyWords(){
		$("#hulue_bottom").css("display","");
		$("#hulue_top").css("display","");
		$("#tpl").css("display","none");
		$("#main").css("display","");
		var keywd = $("#keyword").val();
		document.location.href="content-listnotin.action?tflag=3&topic.topicId="+topicId+"&content.keywords="+keywd+"&content.contentStatus=3";
	}
	
	//栏目首页模板
	function selectIndex(){
		var url = "${ctx}/theme/file-select.action?type=topic&prefix=index&suffix=tpl&elementId=topicselectIndex"; 
		window.open(url); 
	}
	//栏目文章列表模板
	function contentListTpl(){
		var url = "${ctx}/theme/file-select.action?type=topic&prefix=list&suffix=tpl&elementId=topicContentListTpl"; 
		window.open(url); 
	}
	//栏目的默认文章模板
	function defaultContentTpl(){
		var url = "${ctx}/theme/file-select.action?contentType=article&prefix=list&suffix=tpl&elementId=topicDefaultContentTpl"; 
		window.open(url); 
	}
	//栏目的可选文章模板
	function contentTplSet(){
		var url = "${ctx}/theme/file-select.action?contentType=article&prefix=list&suffix=tpl&elementId=topicContentTplSet"; 
		window.open(url); 
	}
	
	//普通文章编辑
	function  goContentEdit(param,id){
		document.location.href="content-input.action?"+param+"="+id+"&orig=edit&orig=input&contextType=0&content.category.categoryId=<s:property value="content.category.categoryId"/>&topic.topicId="+topicId+"&tflag="+1;
	}
	//普通文章删除
	function goContentDel(id){
		if(confirm(confirmStr))
		document.location.href="content-delete.action?key="+id+"&orig=edit&orig=input&contextType=0&content.category.categoryId=<s:property value="content.category.categoryId"/>&topic.topicId="+topicId+"&tflag="+1;
	}
	//批量删除
	function goBatchDel(){
		var ids = inputvalue();
		
		if(ids=="on"){
			alert("您未选择任何一个");
			return; 
		}
		if(!ids){
			alert("您未选择任何一个");
			return;
		}
		if(confirm(confirmStr))
			document.location.href="content-delete.action?ids="+ids+"&orig=edit&orig=input&contextType=0&topic.topicId="+topicId+"&tflag="+1;
	}
	
	function goPublish(id,flag){
		document.location.href="content-publish.action?orig=input&contextType=0&content.contentId="+id+"&cflag="+flag+"&topic.topicId="+topicId+"&tflag="+1;
	}
	
	var topicName = $("#topicName").val();
	
	function goNormalContentNew(){
		document.location.href="content-input.action?orig=input&contextType=0&topic.topicId="+topicId+"&topic.topicName="+topicName+"&tflag="+1;
	}
	function goPictureContentNew(){
		document.location.href="picturecontent-input.action?orig=input&contextType=0&topic.topicId="+topicId+"&topic.topicName="+topicName+"&tflag="+1;
	}
	function goVideoContentNew(){
		document.location.href="videocontent-input.action?orig=input&contextType=0&topic.topicId="+topicId+"&topic.topicName="+topicName+"&tflag="+1;
	}
	function goFlashContentNew(){
		document.location.href="flashcontent-input.action?orig=input&contextType=0&topic.topicId="+topicId+"&topic.topicName="+topicName+"&tflag="+1;
	}
	function goLinkContentNew(){
		document.location.href="linkcontent-input.action?orig=input&contextType=0&topic.topicId="+topicId+"&topic.topicName="+topicName+"&tflag="+1;
	}
	function goSoftwareContentNew(){
		document.location.href="softwarecontent-input.action?orig=input&contextType=0&topic.topicId="+topicId+"&topic.topicName="+topicName+"&tflag="+1;
	}
	function goAudit(id,flag){
		document.location.href="content-input.action?orig=input&contextType=0&content.contentId="+id+"&cflag="+flag+"&topic.topicId="+topicId+"&tflag="+1;
	}
	function unlock(id){
		document.location.href="content-unlock.action?orig=input&contextType=0&content.category.categoryId=<s:property value="content.category.categoryId"/>&content.contentId="+id+"&topic.topicId="+topicId+"&tflag="+1;
	}
	function goSoftEdit(param,id){
		document.location.href="softwarecontent-input.action?"+param+"="+id+"&orig=edit&topic.topicId="+topicId;
	}
	function goVideoEdit(param,id){
		document.location.href="videocontent-input.action?"+param+"="+id+"&orig=edit&topic.topicId="+topicId;
	}
	function goPicEdit(param,id){
		document.location.href="picturecontent-input.action?"+param+"="+id+"&orig=edit&topic.topicId="+topicId;
	}
	function goFlashEdit(param,id){
		document.location.href="flashcontent-input.action?"+param+"="+id+"&orig=edit&topic.topicId="+topicId;
	}
	function goLinkEdit(param,id){
		document.location.href="linkcontent-input.action?"+param+"="+id+"&orig=edit&topic.topicId="+topicId;
	}
	function goDelPicContent(id){
		document.location.href="content-delete.action?key="+id+"&content.topic.topicId="+topicId+"&tflag=1";
	}
	function goEditPicContent(param,id){
		document.location.href="content-input.action?"+param+"="+id+"&orig=edit&content.topic.topicId="+topicId+"&tflag=1";
	}
	$(document).ready(function() {
		var tpls = "<s:property value="content.category.catContentTplSet"/>";
		var tpl = tpls.split(",");
		var str = "";
		for(var i = 0;i<tpl.length;i++){
			str+="<option value="+tpl[i]+">"+tpl[i]+"</option>";
		}
		$("select[name=contentTpl]").append(str);
	});
	
	function window_height(){
		var minheight=500;//设置最小高度
		if (window.innerHeight)
			winHeight = window.innerHeight;
		else if ((document.documentElement) && (document.documentElement.clientHeight))
			winHeight = document.documentElement.clientHeight;
		if (winHeight-73<minheight){
			the_height=minheight;
		}
		else {
			the_height=(winHeight-73);
		}
		$(".popmenu").css("height",the_height);
		$(".popmain").css("height",the_height);
	}
	window_height();
	$(window).resize(window_height);
	</script>